package solitaire.deck;
	
public enum Suit{
		
	Hearts(0), Spades(1), Diamonds(2), Clubs(3);
		
	private int suitNr;
		
	private Suit(int nr){
		suitNr = nr;
	}
		
	public int getNr(){
		return suitNr;
	}
	
	public static Suit getSuitNumber(int suitNumber){
            
		if(suitNumber < 0 || suitNumber  >11){
			throw new IllegalArgumentException("The suit number should be in the range [0,11].");
		}
            
		switch(suitNumber){
    		case 0:
    			return Hearts;
    		case 1:
    			return Spades;
    		case 2:
    			return Diamonds;
    		case 3:
    			return Clubs;
    		default:
    			throw new IllegalArgumentException("Don't know what to do with the number " +suitNumber);                       
		}
	}
}

